<!-- 选择使用优惠券 -->
<template>
	<view>
		<view class="discount">
			<view class="discounteach marginAuto blockbg" v-for="(item,index) in disdata" :key="index" @click="usefun(item,index)">
				<view class="diseachl">
					<view class="diseachl-moeny">
						<text style="font-size:40rpx;">￥</text>
						<text style="font-size:60rpx;">{{ item.amount }}</text>
					</view>
					<view class="diseachl-dec">无门槛</view>
				</view>
				<view class="diseachc">
					<view class="diseachc-name flex">
						<view class="diseachcnq" v-if="item.use_type == 1">学车</view>
						<view class="diseachcnq" v-if="item.use_type == 2">验车</view>
						<view class="diseachcnq" v-if="item.use_type == 3">陪驾</view>
						<view class="diseachc-namename">{{ item.coupon_name }}</view>
					</view>
					<view class="flex">
						<view class="diseachc-time" style="margin-top:16rpx;">有效期至：</view>
						<view class="diseachc-time" style="margin-top:16rpx;">{{ $uv.timeFormat(item.use_end_time,'yyyy-mm-dd hh:MM:ss')  }}</view>
					</view>
				</view>
				<view class="diseachr">
					<uv-icon name="checkmark-circle-fill" size="22" :color="item.ac ? '#1686F8':'#E8E8E8'"></uv-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			disdata: {
				type: Array,
				default: []
			},
		},
		data() {
			return {
				
			};
		},
		onLoad() {
			
		},
		methods: {
			usefun(item){
				this.$emit('disusefun',item)
			}
		}
	};
</script>

<style scoped lang="scss">
	.blockbg {
		width: 640rpx;
		border-radius: 20rpx;
		background-color: #fff;
		padding: 24rpx;
		margin-top: 20rpx;
	}
	// 内容部分
	.discounteach{
		position: relative;
		display: flex;
		justify-content: space-between;
		overflow: hidden;
		.diseachl{
			width: 160rpx;
			border-right: 1px solid #EAEAEA;
			.diseachl-moeny{
				color:#222222;
			}
			.diseachl-dec{
				font-size: 24rpx;
				color:#999999;
				text-align: center;
			}
		}
		.diseachc{
			width:60%;
			.diseachc-name{
				font-size: 32rpx;
				color:#333;
				line-height:44rpx;
				margin-top: 10rpx;
				.diseachcnq{
					display: inline-block;
					padding:0 10rpx;
					background: #E7F2FF;
					color:#0089FB;
					font-size:24rpx;
					text-align: center;
					margin-right: 10rpx;
					border-radius: 5rpx;
				}
			}
			.diseachc-time{
				color: #999999;
				font-size: 20rpx;
				line-height:30rpx;
			}
		}
		.diseachr{
			width: 60rpx;
			height: 60rpx;
			line-height:60rpx;
			margin-top: 40rpx;
		}
		.dqimg{
			position: absolute;
			left:-0rpx;
			bottom: -40rpx;
			width:200rpx;
			height: 156rpx;
		}
	}
</style>